package net.oschina.app.testcase.versionCheck;

import net.oschina.app.testcases.favorites.BasicTestCase;

/**
 * Created by Administrator on 2017/6/30.
 */

public class VersionCheck extends BasicTestCase {

    @Override
    public void setUp() throws Exception {
        super.setUp(true);

    }

    public void testName() throws Exception {
        //版本校验测试案例

        helper.getPageNavigation().clickMyTab();
        helper.getPageMyTab().clickLoginIcon();
        helper.getPageLogin().login("735723619@qq.com","12345678");
        helper.getPageMyTab().clickSettingsImageBtn();
        helper.getPageSettings().clickAbout();
        String expectedValue = "v2.9.6(1609281026)";
        String actualVaule = helper.getPageAbout().getVersion();
        assertEquals(expectedValue,actualVaule);


       /* //选择 我的
        solo.clickOnView(solo.getView("net.oschina.app:id/nav_item_me"));
        //点击 我的头像登录
        solo.clickOnView(solo.getView("net.oschina.app:id/iv_portrait"));
        // 定位用户名 框
        EditText nameET = (EditText) solo.getView("net.oschina.app:id/et_username");
        solo.clearEditText(nameET);
        //定位 密码框
        EditText pwdET = (EditText) solo.getView("net.oschina.app:id/et_password");
        solo.clearEditText(pwdET);
        //输入用户名
        solo.enterText(nameET,"735723619@qq.com");
        //输入密码
        solo.enterText(pwdET,"12345678");
        //定位登录按钮
        Button loginBtn = (Button) solo.getView("net.oschina.app:id/btn_login");
        //点击登录 按钮
        solo.clickOnView(loginBtn);
        // 点击  设置 按钮
        solo.clickOnView(solo.getView("net.oschina.app:id/iv_logo_setting"));
        //点击 关于我们
        solo.clickOnView(solo.getView("net.oschina.app:id/rl_about"));
        //预期值
        String expectedValue = "v2.9.6(1609281026)";
        //实际值
        TextView version = (TextView) solo.getView("net.oschina.app:id/tv_version_name");
        assertEquals(expectedValue,version.getText().toString());*/

    }
}
